import request from "./request";

export const getIndexList = (index) => request({ url: `/indexList/${index}/data/1`, method: 'get' })

export const getSearchList = (keyword, params) => request({ url: `/search/searchList?keyword=${keyword}`, method: 'get', params })

export const getCategoryList = () => request({ url: `/categoryList`, method: 'get' })

export const getGoodById = (id) => request({ url: `/good/getGoodById`, method: 'get', params: { id } })

export const login = (params) => request({ url: `/login`, method: 'post', params })

export const getVerificationCode = (tel) => request({ url: `/getVerificationCode?tel=${tel}`, method: 'get' })

export const saveUser = (params) => request({ url: `/saveUser`, method: 'post', params })

export const register = (params) => request({ url: `/registerUser`, method: 'post', data: params })

export const checkUser = (params) => request({ url: `/checkUser`, method: 'post', params })

export const changePwd = (params) => request({ url: `/changePwd`, method: 'post', data: params })

export const addCart = (params) => request({ url: `/addCart`, method: 'post', data: params, headers: { token: true } })

export const getCartList = (params) => request({ url: `/cartList`, method: 'get', params, headers: { token: true } })

export const removeCart = (params) => request({ url: `/removeCart`, method: 'post', data: params, headers: { token: true } })

